Repository navigation
Test the symbols exported by libzstd.so, hide ZSTD_isDeterministicBuild() with the experimental API - #5055
Merged
Conversation
ZSTD_isDeterministicBuild() (#4331) is declared in the experimental section of zstd.h, but tagged ZSTDLIB_API: it stayed exported when ZSTDLIB_STATIC_API=ZSTDLIB_HIDDEN hides the experimental API. Default builds are unchanged.
libzstd_builds.sh now checks that libzstd.so exports the whole API by default, and only the stable API when ZSTDLIB_STATIC_API and ZDICTLIB_STATIC_API are hidden. The API is read from the headers, outside and inside their static-linking-only sections.
terrelln
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This affects builds that hide the experimental API from
libzstd.so:ZSTDLIB_STATIC_API=ZSTDLIB_HIDDENandZDICTLIB_STATIC_API=ZDICTLIB_HIDDENwith Make, or theZSTDLIB_STATIC_APIoption with CMake (#4789). Default builds are unchanged.Problem
No test checks which symbols
libzstd.soexports.ZSTD_isDeterministicBuild()(#4331, v1.6.0) is declared in the experimental section ofzstd.h, but taggedZSTDLIB_API, so it stays exported when the experimental API is hidden.Fix
ZSTD_isDeterministicBuild()is now taggedZSTDLIB_STATIC_API.tests/libzstd_builds.sh(joblz4-threadpool-libs) buildslibzstd.sotwice, and comparesnm -Dwith the functions declared byzstd.h,zdict.handzstd_errors.h:ZSTD_STATIC_LINKING_ONLYandZDICT_STATIC_LINKING_ONLYsections.GCC's
-aux-infolists the declarations.Test
The new check passes with the fix. It fails without it (
ZSTD_isDeterministicBuildexported by the hidden build), when a stable function loses itsZSTDLIB_APItag, and when an internal function gets default visibility.